require 'map_editor/tile_panel'
require 'gadgets/frame'

module EventEditor
  class CharacterSelecter
    attr_accessor :sx, :sy
    def initialize
      @frame = Frame.new
      @sx, @sy = 0, 0
    end
    
    def target=(target)
      @target = target
    end

    
    def on_double_clicked(event)
    
    end
    
    def on_left_down(event)
      @sx, @sy = @target.get_abs_location(event.x, event.y)
      @target.render
    end
    
    def on_left_up(event)
    
    end
    
    def on_right_down(event)

    end
    
    def on_right_up(event)
    end
    
    
    def on_motion(event)
    end
    
    def render(s)
      @frame.render(s, @target.grid_width, @target.grid_height, @sx - @target.left_count, @sy - @target.top_count)
    end
  end
end